#ifndef __WIRELESS_H_
#define __WIRELESS_H_

#include "main.h"

extern const char *floatIdentifiers[];			
extern float floatValues[];
extern const char *stringIdentifiers[];		
extern const char *stringValues[];	

typedef struct {
    uint8_t receiveDataFlag;				//接收数据标志位
    uint8_t sendDataFlag;					//发送数据标志位
	uint8_t wirelessInitFlag;				//无线模块初始化完成标志位
    uint16_t wirelessInitErrorCode;			//无线模块初始化错误代码
}Wireless_TypeDef;

extern Wireless_TypeDef WirelessStatus;


void Remove_Trailing_Crlf(char *str);

void Wireless_Buffer_Clear(void);
void Wireless_Error_Handler(uint16_t ErrorCode);
void Wireless_Extract_Receive_Command(const char *json_data, char *id, int *command);
void Wireless_Init(void);
void Wireless_Loop(void);
void Wireless_Publish_Data(unsigned char count, const char *identifiers[], float values[], unsigned char stringCount, const char *stringIdentifiers[], const char *stringValues[]);
void Wireless_Receive_Ack_CloudPlatform(char *AckString, char *id);
void Wireless_Receive_Command_Control(int cmdValue);
void Wireless_Receive_Command_Respond(const char * str);
uint8_t Wireless_Send_Command(char *cmd, char *res, uint8_t sendCount);
void Wireless_Usart_Send(char *cmd);

#endif
